Page({
  data: {
    takingId: null, //取餐号
    datetime: null, //当前时间
    takeTime: null, //预计取餐时间
    token: null //token令牌
  },

  onLoad(options) {
    //保存当前this指针
    let that = this

    //获取缓存的当前时间，预计取餐时间和取餐号信息,并赋值
    let datetime = wx.getStorageSync('datetime')
    let takeTime = wx.getStorageSync('takeTime')
    let takingId = wx.getStorageSync('takingId')

    this.setData({
      datetime: datetime,
      takeTime: takeTime,
      takingId: takingId
    })
  },

  //当退出支付成功界面时，清除当前时间,预计取餐时间和取餐号信息
  onHide() {
    wx.setStorageSync('datetime', null)
    wx.setStorageSync('takeTime', null)
    wx.setStorageSync('takingId', null)
  },

  //跳转到点餐页面
  goHome() {
    wx.reLaunch({
      url: '/pages/home/home',
    })
  }

})